package com.wnxy.sddfp.bank.mq;

import com.wnxy.sddfp.common.constant.MQConstant;
import com.wnxy.sddfp.common.model.dto.bank.BankCardRequestDto;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MessageProducer {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void sendMsg(BankCardRequestDto bankCardRequestDto) {
        rabbitTemplate.convertAndSend(
                MQConstant.SDDFP_CARD_EXCHANGE,
                MQConstant.SDDFP_CARD_SEND_ROUTING_BIND,
                bankCardRequestDto
        );
    }
}
